<?php
  $dbconn = new mysqli("202.116.162.2", "xfwang", "13622244006", "xfwang", "3306");
  $sqlStat = 'SELECT fam_no, fam_nm_la FROM cat_fam ORDER BY fam_no ASC;';
  if ($sqlQuery = $dbconn->query($sqlStat)){
    while($sqlResult = $sqlQuery->fetch_assoc()){
      $output = sprintf('<option value = "%d">%s</option>', $sqlResult['fam_no'], $sqlResult['fam_nm_la']);
      echo $output;
    }
  }
  $dbconn->close;
 ?>
